# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2023-01-09
desc: 
sample: 
"""


# 对象 名词
class Message:
    # 静态属性，所有Message对象公用的,类属性
    country = "中国"

    def __init__(self, msg):
        # 单个对象属性
        self.x1 = msg
        self.__x2="test"

    def send(self):
        print(self.x1, self.__x2)

    @property #普通方法，变成属性调用
    def send1(self):
        print(self.x1)

    @staticmethod  # 静态方法并不是真正意义上的类方法，它只是一个被放到类里的函数而已
    def show():
        print("staticmethod")

    @classmethod  #类方法 一些框架里面有用
    def get_info(cls):
        pass

print(Message.country)
print(Message.show())  # 类方法，静态方法

m1 = Message("测试1")
print(m1, m1.x1, m1.country)
m1.x2="1212"
m1.x3="1212"
m1.send()
m1.send1
m1.show()
#
m2 = Message("测试2")
print(m2, m2.x1, m1.country)


class Message2(Message):
    pass

# msg2 =Message("messg2")
# msg2.send()
